package com.uhealin;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class HotelGrouping extends WritableComparator{
	
	protected HotelGrouping () {
		super(Hotel.class,true);
	}

	@Override
	public int compare(WritableComparable a, WritableComparable b) {
		// TODO 자동 생성된 메소드 스텁
		Hotel h1=(Hotel)a,h2=(Hotel)b;
		/*
		int re=0;
		
		int r1x=h1.getXa().get()
		,r1y=h1.getYa().get()
		,r2x=h2.getXa().get()
	    ,r2y=h2.getYa().get();
		
		if(r1x==r2x){
			
			if(r1y==r2y){
				re=0;
			}else{
				re=r1y>r2y?1:-1;
			}
			
		}else{
			re=r1x>r2x?1:-1;
		}
		*/
		return h1.compareTo(h2);
	}
	
	

}
